/**
 * This class will detail the constants and behavior of the asteroids
 * in this game.  
 */

package com.PortalAsteroidjava;

import com.badlogic.gdx.graphics.*;
import com.badlogic.gdx.graphics.g2d.*;

public class Asteroid extends Sprite {
	//The size of an asteroid
	public static final int SIZE = 20;
	
	//The max speed of an asteroid
	public static final double MAX_SPEED = 2.0;
	
	//How many hits each asteroid can take
	public int hitsRemaining;
	
	/** 
	 * A constructor for the asteroids.
	 * It will take some starting coordinates
	 * and will always initialize with a velocity
	 * equal to the max.
	 */
	 public Asteroid(float x, float y)
	 {
		 super(PortalAsteroidjava.asteroidTexture, SIZE, SIZE);
		 
		 this.setPosition(x,y);
		 this.hitsRemaining = 3;
	 }
	 
	 /**
	  * Handles a collision between this asteroid and any obstacles
	  * it can collide with, including the player's ship, missles,
	  * and enemy ships.
	  */
	 public void collision(Sprite s)
	 {
		 //TO-DO
	 }
	 
	 /**
	  * Bounces the asteroid off the edge of the screen if it leaves the 
	  * bounds of the game.
	  */
	 /*public void outOfBounds(int x1, int y1, int x2, int y2)
	 {
		 if (this.getX() < x1)
			{
				this.translate(x1 + (x1 - this.getX()), 0);
				this.velocity.x = -this.velocity.x;
			}
			else if (this.position.x >= x2)
			{
				this.position.x = x2 - 1 - (this.position.x - x2);
				this.velocity.x = -this.velocity.x;
			}
			
			if (this.position.y < y1)
			{
				this.position.y = y1 + (y1 - this.position.y);
				this.velocity.y = -this.velocity.y;
			}
			else if (this.position.y >= y2)
			{
				this.position.y = y2 - 1 - (this.position.y - y2);
				this.velocity.y = -this.velocity.y;
			}
	 }*/
	 
	 /**
	  * A tick method to move the asteroid
	  */
	 /*public void tick()
	 {
		 super.tick();
	 }*/
	 
	 /**
	  * Return the x-coordinate of this asteroid's
	  * midpoint.
	  */
	 /*public double getMidX()
	 {
		 return this.position.x + SIZE / 2.0;
	 }*/

}
